<template>
 <view class="income">
    <view class="index">
		<view class="nav d_f j_c_c a_i_c">
			<view class="text">Project income/day</view>
			<image src="../../static/ct_0022_返回键深色.png" mode="" class="right" @tap="back"></image>
		</view>
		<view class="text t_a_c ">Invite obtain USDT</view>
		<view class="box d_f j_c_s_a a_i_c m_t_16">
			<view>Notes</view>
			<view v-if="allMoney>=0">earnings：+{{allMoney}}U</view>
			<view v-else>Earnings：{{allMoney}}U</view>
		</view>
		<view class="border" v-if="records.length>0">
			<view v-for="(item,index) in records" :key="index" class="records d_f p_r a_i_c">
				<image src="../../static/1.jpg" mode="" class="upper" v-if="item.type==0"></image>
				<image src="../../static/2.jpg" mode="" class="upper" v-else></image>
				<view class="left">
					<view class="time">{{item.createtime}}</view>
					<view class="back d_f j_c_c a_i_c" style="width: auto;margin-left: 10rpx;">{{item.order_no}}</view>
				</view>
				<view class="right" :class="item.type==1?'active':''" v-if="item.type==0">USDT+{{item.money}}</view>
				<view class="right" :class="item.type==1?'active':''" v-if="item.type==1">USDT-{{item.money}}</view>
			</view>
		</view>
	</view>
 </view>
</template>

<script>
 export default {
   data () {
     return {
       records:[],
	   model:{
		  page:1, 
		  pagesize:30,
	   },
	   total:0,
	   allMoney:0
     }
   },
   components: {

   },
   methods: {
    back(){
    	uni.navigateBack({
    		delta: 1
    	});
    },
	//获取数据
	getData(){
		this.$api.getStaticorder(this.model).then(res=>{
			this.records=this.records.concat(res.data.rows)
			this.total=res.data.total
			this.allMoney=res.data.allMoney
		})
	}
   },
   onLoad() {
	   this.records=[]
     this.getData()
   },
   watch: {

   },
   onReachBottom(){
	  if(this.model.page*this.model.pagesize<this.total){
		  this.model.page+=1
		  this.getData()
	  }
   },
   computed: {

   }
 }
</script>

<style scoped lang='scss'>
.income{
	width: 100%;
	min-height: 100%;
	background: rgb(239, 237, 238);
	.index{
		width: calc(100% - 64rpx);
		margin-left: 32rpx;
		height: 100%;
		padding-bottom: 32rpx;
	}
	.text {
			font-size: 32rpx;
			font-weight: 700;
		color: #000;
		}
	.nav {
		width: 100%;
		height: 100rpx;
		
		position: relative;
	    z-index: 9999;
		
	
		.right {
			width: 20rpx;
			height: 32rpx;
			position: absolute;
			left: 0rpx;
			z-index: 999;
			transform: rotate(180deg);
		}
	}
	.box{
		width: 100%;
		height: 150rpx;
		border-radius: 20rpx;
		background: #3dcc86;
		color: #fff;
		font-size: 28rpx;
	}
	.border{
		width: 100%;
		border-radius: 20rpx;
		min-height: 1200rpx;
		background: #FFFFFF;
		margin-top: 32rpx;
		padding: 10rpx 32rpx;
		
		.records{
			margin-top: 16rpx;
			border-bottom: 1rpx solid #ccc;
			padding-bottom: 20rpx;
		}
		.upper{
			width: 41rpx;
			height: 41rpx;
			margin-top: 32rpx;
		}
		.left{
			margin-left: 10rpx;
			.time{
				font-size: 24rpx;
				color: #9e9e9e;
				margin-left: 12rpx;
			}
			.back{
				width: 400rpx;
				background: rgb(242,242,242);
				border-radius: 20rpx;
				height: 40rpx;
				font-size: 26rpx;
				margin-top: 6rpx;
			}
		}
		.right{
			position: absolute;
			right: 0rpx;
			font-size: 28rpx;
			color: #3fb863;
			margin-top: 32rpx;
		}
		.active{
		 color: red;	
		}
	}
}
</style>